//搜索,导出
$('#search-btn,#export-btn').click(function(){
	var btnId = $(this).attr("id");
	var culesId = parseInt($('#culesId').val());
	var culesSource = $('#culesSource').val();
	var culesStatus = $('#culesStatus').val();
	var startTime = $('#startTime').val();
	var endTime = $('#endTime').val();
	if(startTime && endTime){
		if(startTime > endTime){
			errmsg('开始日期不能大于结束日期');
			return;
		}
	}
	var reqUrl = "/member/cluesmanage";
	if( btnId == 'export-btn' ){
		reqUrl += "/ac/export";
	}
	reqUrl +=( (culesId > 0 ) ? "/culesId/" + culesId : "" )
	reqUrl +=( culesSource ? "/culesSource/" + culesSource : "" )
	reqUrl +=( culesStatus ? "/culesStatus/" + culesStatus : "" )
	reqUrl +=( startTime ? "/ts/" + startTime : "" )
	reqUrl +=( endTime ? "/te/" + endTime : "" ) +".html";
	window.location.href = reqUrl;
});
//设置为已处理
$(".setHandleStatus").click(function (){
	$(this).blur();
	var data = {id:$(this).attr("clue-id")};
	if( data.id.length < 1){
		return errmsg("参数不正确");
	}
	$.ajax({
		url   : '/member/setcluesHandleStatus',
		data  :{data: genboxdata(data)},
		cache : false,
		async : false,
		type  : "POST",
		dataType : 'json',
		success  : function (result){
			if(result.status == 0){
				return errmsg(result.msg);
			}else{
				sucmsg(result.msg);
				window.location.reload();
				return false;
			}
		}
	});
});